package binary;

public class Demo09 {
    public static void main(String[] args) {
        byte b = -3; //11111101
        //符号位扩展：负数时候 byte 转换为 int 高位补充24个1
        System.out.println(Integer.toBinaryString(b));
        //消除符号位扩展：利用掩码计算，消除高位1
        System.out.println(Integer.toBinaryString(b & 0xff));
    }
}
